﻿<Application x:Class="AuchanScan.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
             xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
             xmlns:vm="clr-namespace:AuchanScan.ViewModels" xmlns:local="clr-namespace:AuchanScan"
             xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=Microsoft.Phone">
    <!--Application Resources-->
    <Application.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/Generic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <uriMapper:UriMapper x:Key="UriMapper">
                <uriMapper:UriMapper.UriMappings>
                    <uriMapper:UriMapping Uri="/SearchExtras" MappedUri="/Views/PromosPage.xaml" />
                </uriMapper:UriMapper.UriMappings>
            </uriMapper:UriMapper>
            <Color x:Key="AccentColorPromo">#ff8601</Color>
            <Color x:Key="AccentColorScan">#ab596e</Color>
            <Color x:Key="AccentColorMagasin">#0a7c00</Color>
            <Color x:Key="AccentColorListe">#44aab8</Color>
            <Color x:Key="AccentColorHistorique">#0166be</Color>
            <Color x:Key="AccentColorTrophes">#8fd1ff</Color>
            <Color x:Key="AccentColorSocial">#768899</Color>

            <SolidColorBrush x:Key="AccentBrushPromo" Color="{StaticResource AccentColorPromo}" />
            <SolidColorBrush x:Key="AccentBrushScan" Color="{StaticResource AccentColorScan}" />
            <SolidColorBrush x:Key="AccentBrushMagasin" Color="{StaticResource AccentColorMagasin}" />
            <SolidColorBrush x:Key="AccentBrushListe" Color="{StaticResource AccentColorListe}" />
            <SolidColorBrush x:Key="AccentBrushHistorique" Color="{StaticResource AccentColorHistorique}" />
            <SolidColorBrush x:Key="AccentBrushTrophes" Color="{StaticResource AccentColorTrophes}" />
            <SolidColorBrush x:Key="AccentBrushSocial" Color="{StaticResource AccentColorSocial}" />
            <Style x:Key="ButtonNoStyle" TargetType="Button">
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="MouseOver" />
                                        <VisualState x:Name="Pressed" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                Margin="0" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- TextBlock styles -->

            <!-- TextBlock styles -->

            <Style x:Key="PhoneTextBlockBase" TargetType="TextBlock">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
                <Setter Property="Margin" Value="{StaticResource PhoneHorizontalMargin}"/>
            </Style>

            <Style x:Key="PhoneTextNormalStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}" />

            <Style x:Key="PhoneTextSubtleStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
            </Style>

            <Style x:Key="PhoneTextTitle1Style" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeExtraExtraLarge}"/>
            </Style>

            <Style x:Key="PhoneTextTitle2Style" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
            </Style>

            <Style x:Key="PhoneTextTitle3Style" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
            </Style>

            <Style x:Key="PhoneTextExtraLargeStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeExtraLarge}"/>
            </Style>

            <Style x:Key="PhoneTextGroupHeaderStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
            </Style>

            <Style x:Key="PhoneTextLargeStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
            </Style>

            <Style x:Key="PhoneTextSmallStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
            </Style>

            <Style x:Key="PhoneTextContrastStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneContrastForegroundBrush}"/>
            </Style>

            <Style x:Key="PhoneTextAccentStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
            </Style>

            <Style x:Key="PhoneTextHugeStyle" TargetType="TextBlock" BasedOn="{StaticResource PhoneTextBlockBase}">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeHuge}"/>
            </Style>

            <Style x:Key="StretchListBoxItemStyle" TargetType="ListBoxItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            </Style>

            <vm:ViewModelLocator x:Key="ViewModelLocator" />
            <local:VisibilityConverter x:Key="VisibilityConverter" />


        </ResourceDictionary>


    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService Launching="Application_Launching" Closing="Application_Closing"
                                   Activated="Application_Activated" Deactivated="Application_Deactivated" />
    </Application.ApplicationLifetimeObjects>

</Application>
